/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.edu.com1263.model;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Luiz Cardoso
 */
@Entity
@Table(name="professor")
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class Professor extends Usuario implements Serializable{
	
	private static final long serialVersionUID = 1145044791793649333L;
	
	@Column
	private Boolean administrador = false;
	   
    @OneToMany(cascade = { CascadeType.ALL }, mappedBy = "professor")
	private Collection<Turma> turmas;
    
    @OneToMany(cascade = { CascadeType.ALL }, mappedBy = "professor")
	private Collection<AvaliacaoProfessor> avaliados;
    
    @OneToMany(cascade = { CascadeType.ALL }, mappedBy = "professor", fetch=FetchType.EAGER)
	private Collection<Paradigma> paradigmas;

    public Professor() {
    	setAvaliados(new HashSet<AvaliacaoProfessor>());
    	turmas = new HashSet<Turma>();
    	paradigmas = new HashSet<Paradigma>();
  	  	
    }
    
      
    public Professor(String matProfessor, String nomeProfessor, String emailProfessor) {
		super();
		this.matricula = matProfessor;
		this.nome = nomeProfessor;
		this.email = emailProfessor;
	}

	public Long getId() {
		return id;
	}


	public void setId(Long id) {
		this.id = id;
	}


	public Collection<Turma> getTurmas() {
		return turmas;
	}


	public void setTurmas(Collection<Turma> turmas) {
		this.turmas = turmas;
	}



	public void setAvaliados(Collection<AvaliacaoProfessor> avaliados) {
		this.avaliados = avaliados;
	}


	public Collection<AvaliacaoProfessor> getAvaliados() {
		return avaliados;
	}


	public void setParadigmas(Collection<Paradigma> paradigmas) {
		this.paradigmas = paradigmas;
	}

	public Collection<Paradigma> getParadigmas() {
		return paradigmas;
	}

	public Boolean getAdministrador() {
		return administrador;
	}

	public void setAdministrador(Boolean administrador) {
		this.administrador = administrador;
	}
}
